// getting the pool

var M = 1000;
var pool = new Pool(M);

// dummy
function Obj(UID) {
    this.UID = UID;
}

// creating and attaching some instances
var UID, objInstances = [];
for(i = 1; i <= M; i++) {
    UID = i;
    objInstances[i] = { UID : UID };
    pool.attach(UID, new Obj(UID) );

    // associate relationships
    pool.define(UID, {
        left : {
            getter : "llinkto#" + UID,
            limit : 0,
            check : Obj
        }, right : {
            getter : "rlinkto#" + UID,
            limit : 0,
            check : Obj
        }
    });
}

// linking objects
var iUID, jUID;
for(i = 1; i <= M; i++) {
    for(j = 1; j <= M; j++) {
        pool.link({ left : i, right : j });
    }    
} 

// querying the pool
var q = pool.select({ left : "*", right : "*" });




